<?php

class EventPlaceController extends My_Controller_ActionEvent {

    protected $place;

    public function showAction() {
        $this->setContentTitle(_('XXX_EVENT_PLACE_SHOW_PAGE_TITLE'));

        $code = $this->_getParam('id');
        if (empty($code)) {
            $this->addError($this->translate('XXX_EVENT_PLACE_NOT_FOUND'));
            $url = $this->url(array('controller' => 'event-place'));
            $this->_redirect($url);
        }
        $daoEvent = new Application_Model_DAO_Event();
        $this->view->place = $this->place = $place = $daoEvent->getEventPlaceByColumn($code, 'code');
        if (empty($code)) {
            $this->addError($this->translate('XXX_EVENT_PLACE_NOT_FOUND'));
            $url = $this->url(array('controller' => 'event-place'));
            $this->_redirect($url);
        }

        $this->processEventsByInfoType();
    }

    protected function getEventListByEventTypesRestrict(Application_Model_DAO_Event $daoEvent, Zend_Db_Table_Select $select, $infoType, $startDate, $endDate, $limit = 10) {
        switch ($this->_request->getActionName()) {
            case 'show':
                $daoEvent->limitEventsByPlace($select, (array) $this->place['event_place_id']);
                break;
        }
    }

}

